//
//  SrarchResultUserCell.m
//  BaseProject
//
//  Created by 王洋 on 2020/10/12.
//  Copyright © 2020 王洋. All rights reserved.
//

#import "SrarchResultUserCell.h"

@implementation SrarchResultUserCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.userIcon pp_clipCorners:UIRectCornerAllCorners radius:self.userIcon.frame.size.height/2];
        [self.handleBtn pp_clipCorners:UIRectCornerAllCorners radius:self.handleBtn.frame.size.height/2];
        [self.bgView pp_clipCorners:UIRectCornerAllCorners radius:6];

    });
}

- (void)fillCellWithModel:(UserInfoModel *)model {
    
    [self.userIcon sd_setImageWithURL:[NSURL URLWithString:model.imgUrl] placeholderImage:[UIImage imageNamed:@"placeholder"]];
    self.userName.text = model.nickname;
}

- (IBAction)handleAction:(id)sender {
    
    if (self.SearchResultUserCellBlock) {
        self.SearchResultUserCellBlock();
    }
}

@end
